﻿using Common.Prism.Apps;
using NxChatQQ.Models;
using NxChatQQ.Models.Events;
using Prism.Commands;
using System.Collections.ObjectModel;
using System.Windows.Input;
using Wpf.Ui.Controls;

namespace NxChatQQ.ViewModels.Layouts
{
    public class CollectListLayoutViewModel : BaseViewModel
    {

        private int _CollectListIndex = 0;
        public int CollectListIndex
        {
            get { return _CollectListIndex; }
            set { SetProperty(ref _CollectListIndex, value); }
        }

        public ObservableCollection<NavtabModel> CollectList { get; set; }

        public ICommand SelectionChangedCommand { get; set; }

        public CollectListLayoutViewModel()
        {

            SelectionChangedCommand = new DelegateCommand(SelectionChanged);
            CollectList = new ObservableCollection<NavtabModel>();


            CollectList.Add(new NavtabModel("全部", SymbolRegular.Apps20));
            CollectList.Add(new NavtabModel("聊天记录", SymbolRegular.Clock20));
            CollectList.Add(new NavtabModel("图片与视频", SymbolRegular.VideoClip20));
            CollectList.Add(new NavtabModel("文件", SymbolRegular.Folder20));
            CollectList.Add(new NavtabModel("链接", SymbolRegular.Link20));
            CollectList.Add(new NavtabModel("笔记", SymbolRegular.Note20));
            CollectList.Add(new NavtabModel("其它", SymbolRegular.MoreHorizontal20));
        }

        private void SelectionChanged()
        {
            var item = CollectList[CollectListIndex];
            GetEvent<UpdateNavtabEvent>().Publish(item);

            //if (RecentListIndex >= 0)
            //{
            //    var item = RecentItems[RecentListIndex];
            //    _eventAggregator.GetEvent<UpdateChatEvent>().Publish(item);
            //}
        }
    }
}
